Conversation
|
I think this is complementary to #283 , this doesn't fix the crash, but this avoids stack recursion |
|
I rebased this change onto current
The rebased commit retains the original author: I could not update this PR's head branch: maintainer edits are disabled and my account has no push access to the fork. The branch above is ready to use for updating the source branch or integrating the rebased change. Validation on macOS: Release build with |
Avoid recursive UDP resolve traversal (rebased #292)
|
superseded by #296 |
Often I came across an issue when doing some testing that freezes the entire network stack when using liblsl with a lot of inlets / outlets and a larger portrange (e.g. 128) on my local machine, both in Linux and MacOS.
I think the problem is a combination of number of ports, number of interfaces (I have too many, uni VPNs, VMs, etc), and clients - especially when running locally testing multiple nodes.
This patch keeps the
void resolve_attempt_udp::send_next_querymethod a shallow loop rather than becoming recursive, and seems to fix the problem.I ran a set of tests using my dart bindings with the patch and unpatched version and you can see that the patched version doesn't change the number of calls which unfortunately goes up with the number of ports (as expected), but there's a huge difference in the recursion depth.
The test was done with a continuous resolver, using the following script (and I added some logguru logging in the
resolve_attempt_udp.cppsource):Full results table: stack.csv